package com.baizhi.service;

import com.baizhi.entity.User;
import com.github.pagehelper.PageInfo;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest
public class UserServiceTese {

    @Autowired
    private UserService userService;

    @Test
    public void getUsersPageInfoTest(){

        PageInfo<User> pageInfo = userService.getUsersPageInfo(1,10);
        System.out.println("当前页："+pageInfo.getPageNum());
        System.out.println("上一页："+pageInfo.getPrePage());
        System.out.println("下一页："+pageInfo.getNextPage());
        System.out.println("总页码："+pageInfo.getPages());
        System.out.println("数据总条数"+pageInfo.getTotal());
        pageInfo.getList().forEach(System.out::println);
    }
}
